// 对于不变动的常量，我们一般声明一个变量来代替（用大写）
// 变量代替常量，书写错误时会报错
const TOKEN_NAME = 'hm-news-token'
export const setStorageToken = (token) => {
  localStorage.setItem(TOKEN_NAME, JSON.stringify(token))
}
export const removeStorageToken = () => {
  localStorage.removeItem(TOKEN_NAME)
}
export const getStorageToken = () => {
  return JSON.parse(localStorage.getItem(TOKEN_NAME)) || {}
}
